package com.woniu.bean;

import org.springframework.stereotype.Component;

@Component
public class R {
    private String msg;

    private Integer code;

    private Object data;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static R ok(){
        R r =new R();
        r.code=1;
        r.msg="成功";
        return r;
    }
    public static R error(){
        R r =new R();
        r.code=2;
        r.msg="失败";
        return r;
    }
    @Override
    public String toString() {
        return "R{" +
                "msg='" + msg + '\'' +
                ", code=" + code +
                ", data=" + data +
                '}';
    }
}
